class HouseMade {

    public data: Array<Content> = new Array<Content>();

    public name: String = new String();
    public value!: number;
}

class Content {

    public name: String = "";
    public value!: number;

    constructor(name:String,value:number){
        this.name = name;
        this.value = value;
    }
}

class AifuwoMain1 {




    // public jsonObject =
    // {
    //     "columns": ["ColumnA", "ColumnB", "ColumnC"],
    //     "rows":
    //     [
    //         { "cells": ["A1", "B1", "C1"] },
    //         { "cells": ["A2", "B2", "C2"] }
    //     ]
    // };
    public run() {

        var hoseList = new Array<HouseMade>();
        var houseMade1  = new HouseMade();
        houseMade1.name = "框架";
        houseMade1.value = 101;
        var content1 = new Content("普通框架",102);
        houseMade1.data.push(content1);
        hoseList.push(houseMade1);

        var houseMade2  = new HouseMade();
        houseMade2.name = "模型";
        houseMade2.value = 103;
        var content21 = new Content("普通模型",104);
        var content22 = new Content("门",105);
       
        var content24 = new Content("炤台水池",107);
        var content25 = new Content("把手",108);
        var content26 = new Content("衣通",108);

        houseMade2.data.push(content21);
        houseMade2.data.push(content22);
      //  houseMade2.data.push(content23);
        houseMade2.data.push(content24);
        houseMade2.data.push(content25);
        houseMade2.data.push(content26);

        hoseList.push(houseMade2);

        var houseMade3  = new HouseMade();
        houseMade3.name = "线条模型";
        houseMade3.value = 101;
        var content23 = new Content("线条模型",106);
        houseMade3.data.push(content23);
        hoseList.push(houseMade3);

        var houseMade4  = new HouseMade();
        houseMade4.name = "材质";
        houseMade4.value = 101;
        var content233 = new Content("材质同全屋商家后台材质",106);
        houseMade4.data.push(content233);
        hoseList.push(houseMade4);

        
        console.log( JSON.stringify(hoseList));
    }
    // public run() {
    //     var x = (<DataTable>this.jsonObject);
    //     x.columns.push("ColumnD");
    //     console.log(x.columns.length);
    //     console.log( JSON.stringify(x));
    // }
}

var testt = new AifuwoMain1();
testt.run();